/**
 * 
 */
package de.mbenning.fsim.domain;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * @author Martin.Benning
 *
 */
@Entity
@Table (name = "LAND")
public class Land implements Serializable {

	private static final long serialVersionUID = -9027279525258057464L;
	
	@Id
	@GeneratedValue (strategy = GenerationType.TABLE)
	@Column (name  = "ID", updatable = false, nullable = false)
	private Integer id;

	@Column (name = "NAME", length = 30, unique = true)
	private String name;
	
	@Column (name="KURZNAME", length = 3)
	private String kurzname;
	
	@Column (name = "FLAGGE", length = 255)
	private String flagge;
	
	@Lob
	@Basic(fetch = FetchType.LAZY, optional = true)
	@Column (name = "FLAGGEDATA")
	private byte[] flaggedata;
	
	@OneToOne
	@JoinColumn (name = "KONTINENT_ID")
	private Kontinent kontinent;
	
	public Land() {
	}
	
	public String getFlagge() {
		return flagge;
	}

	public void setFlagge(String flagge) {
		this.flagge = flagge;
	}
	
	public Land(String name) {
		this.name = name;
	}
	
	public Land(Integer id, String name, Kontinent kontinent) {
		this.id = id;
		this.name = name;
		this.kontinent = kontinent;
	}
	
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getKurzname() {
		return kurzname;
	}

	public void setKurzname(String kurzname) {
		this.kurzname = kurzname;
	}

	public Kontinent getKontinent() {
		return kontinent;
	}

	public void setKontinent(Kontinent kontinent) {
		this.kontinent = kontinent;
	}

	public byte[] getFlaggedata() {
		return flaggedata;
	}

	public void setFlaggedata(byte[] flaggedata) {
		this.flaggedata = flaggedata;
	}	
	
}
